package com.pomelo.base.core.bean;

/**
 * 数据库列元素信息
 *
 * @author biankudingcha
 * @date: 2021-07-23
 * @since 0.5.0
 */
public class ColumnMetaData implements java.io.Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 列名称
     */
    private String columnName;

    /**
     * 列大小
     */
    private int columnSize;

    /**
     * 列对应的java类型
     */
    private String columnClassName;

    /**
     * 类型
     */
    private String type;

    /**
     * 注释
     */
    private String remarks;

    /**
     * 类型
     */
    private int dataType;

    /**
     * 是否可为空
     */
    private boolean nullable;

    /**
     * 精度
     */
    private int precision;

    /**
     * 是否可为空
     */
    private int scale;

    public ColumnMetaData(String columnName, int columnSize, String columnClassName, String type, String remarks,
            int dataType, boolean nullable, int precision, int scale) {
        this.columnName = columnName;
        this.columnSize = columnSize;
        this.columnClassName = columnClassName;
        this.type = type;
        this.remarks = remarks;
        this.dataType = dataType;
        this.nullable = nullable;
        this.precision = precision;
        this.scale = scale;
    }

    /**
     * 获取列名称
     *
     * @return String
     */
    public String getColumnName() {
        return columnName;
    }

    /**
     * 获取列长度
     *
     * @return String
     */
    public int getColumnSize() {
        return columnSize;
    }

    /**
     * 获取列映射的类名称
     *
     * @return String
     */
    public String getColumnClassName() {
        return columnClassName;
    }

    /**
     * 获取类型
     *
     * @return String
     */
    public String getType() {
        return type;
    }

    /**
     * 字段说明
     *
     * @return String
     */
    public String getRemarks() {
        return remarks;
    }

    /**
     * 数据库类型
     *
     * @return int
     */
    public int getDataType() {
        return dataType;
    }

    /**
     * 是否为空
     *
     * @return boolean
     */
    public boolean isNullable() {
        return nullable;
    }

    /**
     * 获取位数
     *
     * @return int
     */
    public int getPrecision() {
        return precision;
    }

    /**
     * 获取精度
     *
     * @return int
     */
    public int getScale() {
        return scale;
    }

}
